﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using Exhibition.Common;
using Exhibition.Service;

namespace Exhibition.Handler
{
    /// <summary>
    /// FileUploadHandler 的摘要说明
    /// </summary>
    public class FileUploadHandler : IHttpHandler
    {

        public void ProcessRequest(HttpContext context)
        {
            AJAXJson rtnMessage = new AJAXJson();
            string opType = context.Request["OpType"];
             var controler = new FileUploadService(context);
             switch (opType.ToLower())
             {
                 case "uploadcontent":
                    rtnMessage.ResultMessage=   controler.UploadLogo();
                     break;
                 case "uploadflowpic":
                     rtnMessage.ResultMessage = controler.Uploadflowpic();
                     break;
                 case "uploadfloor":
                     rtnMessage.ResultMessage = controler.Uploadfloor();
                     break;
                 case "uploaduserlogo":
                     rtnMessage.ResultMessage = controler.UploadUserlogo();
                     break;
                 case "uploadbadlogo":
                     rtnMessage.ResultMessage = controler.UploadBadLogo();
                     break;
                 case "uploadsitelogo":
                     rtnMessage.ResultMessage = controler.UploadSitelogo();
                     break;

             }
             context.Response.ContentType = "text/json;charset=UTF-8;";
             context.Response.Write(rtnMessage.ResultMessage);
        }

        public bool IsReusable
        {
            get
            {
                return false;
            }
        }
    }
}